package org.jbit.news.listener;

import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;

import org.apache.log4j.Logger;
import org.jbit.news.entity.User;

//public class OnlineUser implements HttpSessionBindingListener {
	/*private final Logger log = Logger.getLogger(OnlineUser.class);
	private User user;

	public void valueBound(HttpSessionBindingEvent event) {
			ServletContext application=event.getSession().getServletContext();
			List<User> onlineUserList=(List<User>) application.getAttribute("ONLINE_USERS");
				onlineUserList.add(user);
				log.info("用户"+user.getUname()+"上线");
	}

	public void valueUnbound(HttpSessionBindingEvent event) {
		ServletContext application=event.getSession().getServletContext();
		List<User> onlineUserList=(List<User>) application.getAttribute("ONLINE_USERS");
			onlineUserList.remove(user);
			log.info("用户"+user.getUname()+"下线");
			
	}
public User gerUser(){
		return user;
		
	}	
public void setUser(User user){
	
	this.user=user;
}
*/
//}
